#include "GameMenu.h"

CGameMenu::CGameMenu(void)
{
	setOpacity(0);
	m_pSelectedItem = NULL;
}

CGameMenu::~CGameMenu(void)
{
}

CGameMenu* CGameMenu::menuWithItems( CCMenuItem* item, ... )
{
	va_list args;
	va_start(args,item);
	CGameMenu *pRet = new CGameMenu();
	if (pRet && pRet->initWithItems(item, args))
	{
		pRet->autorelease();
		va_end(args);
		pRet->setState(GAMEMENU_NORMAL);
		return pRet;
	}
	va_end(args);
	CC_SAFE_DELETE(pRet)
	return NULL;
}

bool CGameMenu::ccTouchBegan( CCTouch* touch, CCEvent* event )
{
	if (getState() == GAMEMENU_NOTOUCH)
	{
		return false;
	}
	return __super::ccTouchBegan(touch, event);
}

void CGameMenu::ccTouchEnded( CCTouch* touch, CCEvent* event )
{
	if (getState() == GAMEMENU_NOTOUCH)
	{
		return;
	}
	__super::ccTouchEnded(touch, event);
}

void CGameMenu::ccTouchCancelled( CCTouch *touch, CCEvent* event )
{
	if (getState() == GAMEMENU_NOTOUCH)
	{
		return;
	}
	__super::ccTouchCancelled(touch, event);
}

void CGameMenu::ccTouchMoved( CCTouch* touch, CCEvent* event )
{
	if (getState() == GAMEMENU_NOTOUCH)
	{
		return;
	}
	__super::ccTouchMoved(touch, event);
}

